# encoding: utf-8
"""
@author: 夏洛
@QQ: 1972386194
@file: 协议问题.py
"""

# @Author：兔叽要吃肉
# @File: ddd.py
import httpx,requests

url = "https://api.plugshare.com/v3/locations/region?access=1&cost=false&count=500&include_coming_soon=true&latitude=39.5&longitude=-98.35&minimal=0&outlets=[{\"connector\":6,\"power\":1},{\"connector\":13,\"power\":0},{\"connector\":3,\"power\":0},{\"connector\":2,\"power\":0},{\"connector\":6,\"power\":0},{\"connector\":4,\"power\":0}]&spanLat=55.34139856900886&spanLng=87.01171875"

payload={}
headers = {
  'pragma': 'no-cache',
  'cache-control': 'no-cache',
  'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101"',
  'authorization': 'Basic d2ViX3YyOkVOanNuUE54NHhXeHVkODU=',
  'accept-language': 'en',
  'sec-ch-ua-mobile': '?0',
  'referer': 'https://www.plugshare.com/map/free-ev-stations',
  'Cookie': '__cf_bm=R2t0xTJBjhMTkLvCMiFQb1om7TxMhYte_QSOBwOy44s-1654675534-0-AbUkNGzKMs1aQ34SESVU1vaMNafVDLVEmLHJqTekb9MsmQuEXwR/7WAjJoBh5+kyhC8vT5pmKpH3SXWsaDPJ/qtWVp8HDd19S7C9Dp39DXkr'
}

response = httpx.request("GET", url, headers=headers, data=payload)

print(response.text)
print(response)


'''
httpx 支持2.0协议
requests  不支持2.0
'''